<?php
class Solicitudes_Form_Gruposinvestigacion extends Form_Cna {

    public function __construct($options = null) {
        parent::__construct($options);
    }

    public function init() {
        $domConfig = Zend_Registry::get('domConfig'); //esto se crea en el bootstrap
        $this->setName('gruposinvestigacion');
        $this->setMethod("post");
        $this->setAttrib('enctype', 'multipart/form-data');
        
        $array_elements[] = new Zend_Form_Element_Hidden("codseccionlista");
		$array_elements[] = new Zend_Form_Element_Hidden("codproceso");
		$array_elements[] = new Zend_Form_Element_Hidden("codgrupo");
        
        
        $array_colciencias = $domConfig->COLCIENCIAS->toArray();
        
		$element = new Zend_Form_Element_Textarea('nombregrupo');
		$element->setLabel('Nombre del grupo investigación:');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
		$element->setAttrib("rows",2);
		$element->setAttrib("style","width:99%");
        $array_elements[] = $element;

		$element = new Zend_Form_Element_Select('clasificacion');
		$element->setLabel("Clasificación COLCIENCIAS :");
		$element->setRegisterInArrayValidator(false);
		$element->addMultiOption(null, "-- Seleccione --");
		$element->addMultiOptions($array_colciencias);
        $element->setRequired(true);
		$array_elements[] = $element;
		        
        $element = new Zend_Form_Element_Text("proyectos"); //periodo
        $element->setLabel("Número de proyectos :");
        $element->addFilter('StripTags');
        $element->addFilter('StringTrim');
        $element->addValidator('digits');
        $element->setAttrib("size", 7);
        $element->setRequired(true);
        $array_elements[] = $element;
        
       $submit = new Zend_Form_Element_Submit('btnSubmit');
       $submit->setValue('Guardar');
       $submit->setLabel("Guardar");
       $submit->setAttrib("class", "iceCmdBtn");
       $array_elements[] = $submit;
       
       $this->addElements($array_elements);
       $this->loadViewScriptDecorators();
    
    }

    public function loadViewScriptDecorators() {
        $this->setDecorators(array(array('viewScript',array('viewScript'=>'viewscripts/gruposinvestigacion_form.phtml'))));
    }
}